CROSS_COMPILE =  /home/share/work/tda4/linux-sdk/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-none-linux-gnu-
CC	=	$(CROSS_COMPILE)gcc
CXX	=	$(CROSS_COMPILE)g++ -g
#CXX	=	$(CROSS_COMPILE)g++
AR	=	$(CROSS_COMPILE)ar
LD	=	$(CROSS_COMPILE)ld
OBJDUMP =	$(CROSS_COMPILE)objdump
STRIP	=	$(CROSS_COMPILE)strip
RM	=	rm	

TARGET =  dencoder

DIR = $(PWD)
.PHONY:  $(TARGET)	clean


CFLAGS = -Wall
#CFLAGS += -g
#CFLAGS += -I ../include
#CFLAGS += -I ../src

LDFLAGS = -lpthread -lm -ldl

OBJS = main.o DecoderProcess.o
LIBS = 

ARM = arm
INTERL = arm
PWD = $(pwd)

.PHONY: all  install  clean

    	
(TARGET):$(OBJS) $(LIBS)
	mkdir -p $(INTERL)
	$(CXX) -o $(TARGET) $^ $(LDFLAGS)
	$(OBJDUMP) -S $(TARGET) > $(INTERL)/$(TARGET).s			# exe file
	#$(STRIP) $(TARGET)
	#$(OBJDUMP) -S $(TARGET) > $(INTERL)/$(TARGET)$s-strip.s	# exe file	# strip exe file

clean:
	$(RM) -rf $(TARGET) *.o
	@rm -f $(TARGET)
	@rm -f $(TARGET_CPP)
	@rm -f $(OBJS)
	@rm -f $(OBJS_CPP)
	@rm -rf $(ARM)
	@rm -rf $(INTERL)
	@find . -name "*~" | xargs rm > /dev/null 2>&1  &

